text = """Python is a popular programming language. It is widely used for web development, data science, and more.
Python has a simple and readable syntax, which makes it great for beginners."""

# 提取文本当中的单词
words = text.lower().split()
print("获取到的单词列表：")
print(words)

# 创建字典
word_count = {}

# 遍历单词列表
for w in words :
  word = w.strip(",.?!:;")
  if word in word_count :      #拿到的是值
    word_count[word] += 1
  else:
    word_count[word] = 1
# 打印最终统计结果
print(word_count)
# 打印统计字典中key和value的值
for k, v in word_count.items() :
  print(f"{k}, {v}")



